package com.itheima.tlias.exception;

import com.itheima.tlias.pojo.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@Slf4j
@RestControllerAdvice
public class GlobalExceptionHandler {
	@ExceptionHandler
	public Result ex(Exception e) {
		log.error("报错了：{}", e.getMessage());
		return Result.error("接口调用失败，请联系管理员：" + e.getMessage());
	}
}
